<?php
/**
 * ===============================================
 * 版权所有 2019-2050 青岛铁锤科技有限公司，并保留所有权利。
 * 网站地址: http://www.huaxianling.com
 * ===============================================
 * Author: Rag Hu
 * Created Time: 2019/7/23 10:00
 * Modified Time: 2019/7/23 10:00
 * Version: 2.0
 */

namespace App\Lib\File;


use App\Lib\Contracts\FlFile;
use App\Models\Picture;

class AliOssImg implements FlFile
{


    /*
     * 上传图片资源
     */
    public function upload($tmp,$path,$sqlname="图片")
    {
        $ali_oss = new AliOSS();
        $oss = $ali_oss->upload($tmp,$path);

        $new_picture = new Picture();
        $new_picture->name = $sqlname;
        $new_picture->image = $oss['ossName'];
        $new_picture->save();

        return $new_picture;

    }

    public function delete()
    {
        // TODO: Implement delete() method.
    }

    public function getFileSize()
    {
        // TODO: Implement getFileSize() method.
    }

    public function getFileType()
    {
        // TODO: Implement getFileType() method.
    }
}